1. Field of the Invention
This invention relates to a method of selecting a type of compression, more particularly to an automated method of selecting compression for scanned documents.
2. Background of the Invention
Many known scanners allow the user to select compression and image file formats for each scanned image. For example, U.S. Pat. No. 5,488,483, issued Jan. 30, 1996, describes a system in which a user may select between two resolution modes, either G4 or JPEG for encoding of images. Some copier/scanners have separate settings for text documents and for photos. These devices require user intervention to select the file type and the compression technique for each scanned is image. Alternately, devices use the same compression techniques for each side, or face, of a stack of documents to be scanned regardless of the content, type of images on the documents, or image file format. Such devices do not allow the user a choice of compression technique and treat all documents the same. In some cases the devices require the user to decide what type of compression technique is best for a particular document, or for a stack of documents, thus possibly not using the best compression type for some subset of the faces scanned.
Modem document scanners scan a face of a page, and form a digital image of the face. These images are often compressed for faster communications transfer, or to more efficiently store the image. On single sheet, flat bed scanners, the user places a side, or face, of a document on the scanner, selects from a variety of scan options provided by the software that is used with the device, scans the document, and selects the file format for saving the image. This process requires user intervention for each face of each document.
A second type of scanner accepts a stack of documents and automatically feeds each document onto the scanner. These devices treat each face the same and use only one type of file format and compression for every document in the stack. If the stack contains homogenous documents, this operation is a sufficient method of imaging documents. However, a document stack may contain some text pages and some images, and the known techniques do not differentiate between various types of documents. If the same compression technique is used for all documents, even where alternate compression techniques are available, it may adversely affect image quality even if it improves system performance.
Encoding of image data, either for storage or transmission or both is well known. Several examples of techniques of encoding data are directed to using a given coding technique but manipulating the parameters of the encoding process to ensure the highest image quality for a given set of operating conditions. For example, U.S. Pat. No. 5,521,641, issued May 28, 1996, describes a method of manipulating the run length encoding of a document using Huffman tables of reduced size.
U.S. Pat. No. 4,631,598, issued Dec. 23, 1986, provides a system in which variable resolution output is determined by the capabilities of the host computer of the user. It also allows display processing with windowing and compression. A continuation of this patent has also issued as U.S. Pat. No. 5,218,457, on Jun. 8, 1993.
U.S. Pat. No. 4,325,085, issued Apr. 13, 1982, describes a method of compressing data for storage or fax transmission of data. The method uses predictive coding and then checks the coding to ensure high image quality.
U.S. Pat. No. 5,339,368, issued Aug. 16, 1994, describes a method for discrete transformation of image data for storage or transmission.
U.S. Pat. No. 4,837,848, issued Jun. 6, 1989, describes a method for coding using a reference scan line selection method to ensure the most accurate encoding of an image.
U.S. Pat. No. 5,021,891, issued Jun. 4, 1991, describes an adaptive discrete cosine transform system that selects block size based upon a comparison of the transform block and sub-block coding efficiency.
Another aspect of the coding techniques is recovery of the image data without errors, or with minimal errors. For example, U.S. Pat. No. 5,333,211, issued Jul. 26, 1994, describes a method for image compression and decompression using a smoothing filter to avoid artifacts in the reconstructed image. U.S. Pat. No. 5,590,222, issued Dec. 31, 1996, describes a method for recovery of a compressed image with correction for distortion.
U.S. Pat. No. 5,432,871, issued Jul. 11, 1995, describes a compression system in which a lossy-compressed image is transmitted to a user for selection of an area of interest. When the area of interest is identified, more information about that area is transmitted to the user to correct errors in the image from the lossy compression.
Each of the patents relates to compression, however none teach or suggest the selection of a compression technique dependant on the content of the scanned image. Further, there is not provision in the current art for automatically selecting a best compression method based upon the image content, either by itself, or including factors such as system parameters, speed of compression, size of the resultant compression, and image quality.
One aspect of the invention is a method for automatically selecting a best compression method for a scanned image. The scanned image may be one page or several pages. A scanning device acquires the image and portions are selected and compressed using a variety of techniques. The user may select all or a subset of compression techniques to be used in the analysis. The result of each technique is assigned a score. The score can depend upon one or more of a group of system parameters, such as size of the resultant file, speed of compression, or quality of the image. The compression technique with the best score is then used to compress the entire bitmap of the entire image.
Alternatively, the user can select a subset of a multi-page document for the compression analysis. The subset may be selected pages or a range of pages from the document. The user would designate a compression technique for the remaining pages. In this manner, only a few pages will undergo compression analysis, the other pages will be encoded as designated by the user, such as text or graphics.
Alternatively, the user can select one page of a multi-page document for the compression analysis, and designate the compression technique chosen by the analysis for the remaining pages.